package com.zhihu.jjn.demoproject.entity;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author Jiang Jining
 * @date 2020/11/1 10:17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class User {
    @JsonProperty(value = "user_name")
    @JsonAlias(value = {"user_name", "userName"})
    private String userName;

    @JsonProperty(value = "org_id")
    @JsonAlias(value = {"org_id", "orgId"})
    private String orgId;

    @JsonProperty(value = "org_name")
    @JsonAlias(value = {"org_name", "orgName"})
    private String orgName;

    private Integer age;

    private String email;

    @JsonProperty(value = "create_time")
    @JsonAlias(value = {"create_time", "createTime"})
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @JsonProperty(value = "update_time")
    @JsonAlias(value = {"update_time", "updateTime"})
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private Boolean registered;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "register_time")
    @JsonAlias(value = {"register_time", "registerTime"})
    private Date registerTime;
}
